import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;

import javax.swing.*;


public class DialogName extends JDialog implements ActionListener {
	
	JTextField NameField;
	JButton OK;
	String Name;
	
	DialogName(){
		
		setLayout(null);
		setBounds(200,200,400,300);
		setTitle("Podaj imie Gracza");
		
	
		OK = new JButton("OK");
		OK.setBounds(50,60,40,20);
		OK.addActionListener(this);
		add(OK);
		
		NameField = new JTextField();
		NameField.setBounds(20,20,100,20);
		add(NameField);
		
		
		setVisible(true);
		
	}

	@Override
	public void actionPerformed(ActionEvent e) {
			
		Name = NameField.getText();
		NameField.setText("");
		setVisible(false);
				
	}
}
